Skip to content

feat(client): migrate achievements from GraphQL to gRPC#258

Open
MartianGreed wants to merge 1 commit intomainfrom
feat/achievements-grpc
Open

feat(client): migrate achievements from GraphQL to gRPC#258
MartianGreed wants to merge 1 commit intomainfrom
feat/achievements-grpc

Conversation

@MartianGreed
Copy link
Copy Markdown
Collaborator

@MartianGreed MartianGreed commented Jan 8, 2026

Summary

  • Replace GraphQL-based achievement fetching with gRPC using @dojoengine/grpc methods
  • Add fromGrpc() methods to Trophy and Progress models for data mapping
  • Create new gRPC atoms (trophies-grpc.ts, progressions-grpc.ts)
  • Update hooks to use new gRPC atoms
  • Simplify project types (no model selector needed for gRPC)

Changes

  • client/src/models/trophy.ts - Add fromGrpc() static method
  • client/src/models/progress.ts - Add fromGrpc() static method
  • client/src/effect/atoms/trophies-grpc.ts - New gRPC atom for achievements
  • client/src/effect/atoms/progressions-grpc.ts - New gRPC atom for player progress
  • client/src/effect/hooks/achievements.ts - Update imports to use gRPC atoms
  • client/src/effect/atoms/index.ts - Update exports

Test plan

  • Verify achievements display correctly in the browser
  • Check leaderboard calculations match previous implementation
  • Confirm player progress data is accurate

Note

Moves achievements and player progress to gRPC and updates consumers.

  • Add trophies-grpc.ts and progressions-grpc.ts atoms using ToriiGrpcClient.getAchievements/getPlayerAchievements; aggregate results by project and expose trophiesDataAtom/progressionsDataAtom
  • Add fromGrpc() to Trophy and Progress for mapping gRPC payloads
  • Update hooks/achievements.ts to consume new gRPC atoms and simplify project types (no model selector)
  • Update atoms/index.ts exports to point to gRPC versions and remove unused meta types

Written by Cursor Bugbot for commit 8fd33f2. This will update automatically on new commits. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
arcade Ready Ready Preview Jan 8, 2026 8:53am

Replace GraphQL-based achievement fetching with gRPC using @dojoengine/grpc methods (getAchievements, getPlayerAchievements).

- Add fromGrpc() methods to Trophy and Progress models
- Create trophies-grpc.ts and progressions-grpc.ts atoms
- Update hooks to use new gRPC atoms
- Simplify project types (no model selector needed)
achievement,
taskProgress,
playerEntry.stats?.last_achievement_at,
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All player achievements share the same timestamp

High Severity

The Progress.fromGrpc call passes playerEntry.stats?.last_achievement_at as the timestamp for all task progress entries of all achievements belonging to a player. This single player-level timestamp replaces what was previously per-achievement completionTime in the GraphQL implementation. As a result, all achievements for a player will appear to have been completed at the same time, breaking leaderboard calculations that rely on completion order and making achievement event timelines inaccurate. The code likely needs to use a per-achievement completion timestamp (possibly from achievementProgress) rather than the player's overall last_achievement_at.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant